
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;

namespace Swaf.Container
{
	/// <summary>
	/// Classes should implememnt this interface to show support for getting/setting values based on
	/// the namespace address formatting.
	/// </summary>
	/// <remarks>
	/// A namespace address is a '.' delimited list of names in a string that indicates a property to 
	/// get or set deep within an object tree contained within the object implementing this interface.  
	/// Examples of a namespace address include:
	/// <ul>
	/// <li>"street" - A single address within the namespace address.  The object implemting this
	/// interface would need to get/put the "street" property directly.</li>
	/// <li>"address.street" - This object would need to get/put a property called "address",
	/// and call get/put on that property for the "street" part of the namespace address.</li>
	/// <li>"user.address.street" - This object would need to get/put on "user", then call get/put on
	/// the "user" property with "address.street".</li>
	/// </ul>
	/// </remarks>
	public interface IDependantNameAddressSupport
	{
		/// <summary>
		/// Given a valid namespaceAddress format, calls to put will take the val provided and
		/// pass it deep within an object tree to the node addressed to save the value
		/// </summary>
		/// <param name="nameAddress"></param>
		/// <param name="val"></param>
		void put(object parent, string nameAddress, object val);
		void put(object parent, string nameAddress, object val, object extraInfo);

		/// <summary>
		/// Given a valid namespaceAddress format, calls to get will go deep within an object tree
		/// to the node addressed with the <c>namespaceAddress</c> parameter to get a value to return.
		/// </summary>
		/// <param name="nameAddress"></param>
		/// <returns></returns>
		object get(object parent, string nameAddress, params object[] infoArgs);
		object get(object parent, string nameAddress, object oneArg);
		object get(object parent, string nameAddress);

		bool getIsGetOnly(object parent, string name);
		XmlSerializationSupport getSerializationSupport(object parent, string name);
		string getXml(object parent, string name, string options);
		bool containsField(object parent, string name, String nameAddress);
	}	
}
